﻿<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>给予者联盟</title>
  <link rel="stylesheet" href="css/layui.css" id="layui">
  <link rel="stylesheet" href="css/theme/default.css" id="theme">
  <link rel="stylesheet" href="css/kitadmin.css" id="kitadmin">

</head>

<body class="layui-layout-body kit-theme-default">
  <div class="layui-layout layui-layout-admin">
    <!-- header -->
    <div class="layui-header">
      <div class="layui-logo">
        <div class="layui-logo-toggle" kit-toggle="side" data-toggle="on">
          <i class="layui-icon">&#xe65a;</i>
        </div>
        <div class="layui-logo-brand">
          <a href="#/">给予者联盟</a>
        </div>
      </div>
      <div class="layui-layout-left">
        <!-- <div class="kit-search">
          <form action="/">
            <input type="text" name="keyword" class="kit-search-input" placeholder="关键字..." />
            <button class="kit-search-btn" title="搜索" type="submit">
              <i class="layui-icon">&#xe615;</i>
            </button>
          </form>
        </div> -->
      </div>
      <div class="layui-layout-right">
        <ul class="kit-nav" lay-filter="header_right">
         <!--  <li class="kit-item" kit-target="help">
            <a href="javascript:;">
              <i class="layui-icon">&#xe607;</i>
              <span>帮助</span>
            </a>
          </li>
          <li class="kit-item" id="ccleft">
            <a href="javascript:;">
              <i class="layui-icon">&#xe60e;</i>
            </a>
          </li>
          <li class="kit-item" id="cc">
            <a href="javascript:;">
              <i class="layui-icon">&#xe64c;</i>
            </a>
          </li> -->
          <li class="kit-item">
            <a href="javascript:;">
              <span id="name">
                
              </span>
            </a>
            <ul class="kit-nav-child kit-nav-right">
              <li class="kit-nav-line"></li>
              <li class="kit-item">
                <a href="/admin/login.html">
                  <i class="layui-icon">&#x1006;</i>
                  <span>注销</span>
                </a>
              </li>
            </ul>
          </li>
        </ul>
      </div>	
    </div>
    <!-- silds -->
    <div class="layui-side" kit-side="true">
      <div class="layui-side-scroll">
        <div id="menu-box">
          <ul class="kit-menu">
            <li class="kit-menu-item">
              <a href="#/layui/index">
                <i class="layui-icon"></i>
                <span>首页</span>
              </a> 
            </li>
            <li class="kit-menu-item">
              <a href="javascript:;">
                <i class="layui-icon"></i>
                <span>基础数据</span>
              </a>
              <ul class="kit-menu-child layui-anim layui-anim-upbit" data-value="0">
                <!-- <li class="kit-menu-item">
                  <a href="#/layui/pingtaishezhi">
                    <i class="layui-icon"></i>
                    <span>平台设置</span>
                  </a>
                </li>
                <li class="kit-menu-item">
                  <a href="#/layui/shouquanshezhi">
                    <i class="layui-icon"></i>
                    <span>授权设置</span>
                  </a>
                </li>
                <li class="kit-menu-item">
                  <a href="#/layui/sharePoster">
                    <i class="layui-icon"></i>
                    <span>分享海报</span>
                  </a>
                </li>
                <li class="kit-menu-item">
                  <a href="#/layui/memberLev">
                    <i class="layui-icon"></i>
                    <span>会员等级</span>
                  </a>
                  
                  
                </li> -->
                
              
              </ul>
            </li>
            <li class="kit-menu-item">
              <a href="javascript:;">
                <i class="layui-icon"></i>
                <span>会员管理</span>
              </a>
              <ul class="kit-menu-child layui-anim layui-anim-upbit" data-value="1">
                <!-- <li class="kit-menu-item">
                  <a href="#/layui/memberList">
                    <i class="layui-icon"></i>
                    <span>会员列表</span>
                  </a>
                  
                  
                </li>
                <li class="kit-menu-item">
                  <a href="#/layui/meetList"> 
                    <i class="layui-icon"></i>
                    <span>会议列表</span>
                  </a>
                  
                </li>
                <li class="kit-menu-item">
                  <a href="#/layui/popuList">
                    <i class="layui-icon"></i>
                    <span>人气列表</span>
                  </a>
                </li>
                
                <li class="kit-menu-item">
                  <a href="#/layui/pinglunMana">
                    <i class="layui-icon"></i>
                    <span>评论管理</span>
                  </a>
                  
                </li>
                <li class="kit-menu-item">
                  <a href="#/layui/zhiweiList">
                    <i class="layui-icon"></i>
                    <span>职位列表</span>
                  </a>
                </li>
                <li class="kit-menu-item">
                  <a href="#/layui/hangyeList">
                    <i class="layui-icon"></i>
                    <span>行业列表</span>
                  </a>
                </li> -->
                
              </ul>
             
            </li>
            <li class="kit-menu-item">
              <a href="javascript:;">
                <i class="layui-icon"></i>
                <span>商脉管理</span>
              </a>
              <ul class="kit-menu-child layui-anim layui-anim-upbit" data-value="2">
                <!-- <li class="kit-menu-item">
                  <a href="#/layui/fenhuiguanli"> 
                    <i class="layui-icon"></i>
                    <span>分会管理</span>
                  </a>
                  
                  
                  <ul class="kit-menu-child layui-anim layui-anim-upbit">
                    <li class="kit-menu-item">
                      <a href="#/layui/fenhuiMemList">
                        <i class="layui-icon">&#xe62e;</i>
                        <span>分会成员列表</span>
                      </a>
                      <ul class="kit-menu-child layui-anim layui-anim-upbit">
                      	<li class="kit-menu-item">
				                  <a href="#/layui/changeFHMemLev">
				                    <i class="layui-icon"></i>
				                    <span>分会会员等级变更</span>
				                  </a>
				                </li>
                      </ul>
                    </li>
                  </ul> -->
                  
                  
                <!-- </li>
                <li class="kit-menu-item">
                  <a href="#/layui/fenhuiCheckList">
                    <i class="layui-icon"></i>
                    <span>分会审核列表</span>
                  </a>
                </li> -->
                
                
                
              </ul>
              
             <!--  <ul class="kit-menu-child layui-anim layui-anim-upbit">
                <li class="kit-menu-item">
                  <a href="#/layui/busiguanli">
                    <i class="layui-icon"></i>
                    <span>商圈管理</span>
                  </a>
                </li>
                <li class="kit-menu-item">
                  <a href="#/layui/busiCheckList">
                    <i class="layui-icon"></i>
                    <span>商圈审核列表</span>
                  </a>
                </li>
              </ul> -->
              
              
              
            </li>
            <li class="kit-menu-item">
              <a href="javascript:;" class="child">
                <i class="layui-icon"></i>
                <span>产品管理</span>
              </a>
              <ul class="kit-menu-child kit-menu-child layui-anim layui-anim-upbit" data-value="3">
                
                <!-- <li class="kit-menu-item">
                  <a href="#/layui/prodList" class="child">
                    <i class="layui-icon"></i>
                    <span>产品列表</span>
                  </a>
                </li> -->
                
              </ul>
            </li>
            <li class="kit-menu-item">
              <a href="javascript:;" class="child">
                <i class="layui-icon"></i>
                <span>官网管理</span>
              </a>
              <ul class="kit-menu-child kit-menu-child layui-anim layui-anim-upbit" data-value="4">
                
                <!-- <li class="kit-menu-item">
                  <a href="#/layui/webManage" class="child">
                    <i class="layui-icon"></i>
                    <span>官网管理</span>
                  </a>
                </li> -->
                
              </ul>
            </li>
            
            <li class="kit-menu-item">
              <a href="javascript:;">
                <i class="layui-icon"></i>
                <span>系统设置</span>
              </a>
              <ul class="kit-menu-child layui-anim layui-anim-upbit" data-value="5">
                <!-- <li class="kit-menu-item">
                  <a href="#/layui/quanxianMana">
                    <i class="layui-icon"></i>
                    <span>权限管理</span>
                  </a>
                </li>
                <li class="kit-menu-item">
                  <a href="#/layui/managerList">
                    <i class="layui-icon"></i>
                    <span>管理员设置</span>
                  </a>
                </li>
                <li class="kit-menu-item">
                  <a href="#/layui/pageList">
                    <i class="layui-icon"></i>
                    <span>页面设置</span>
                  </a>
                </li>
                <li class="kit-menu-item">
                  <a href="#/layui/backups">
                    <i class="layui-icon"></i>
                    <span>数据库备份</span>
                  </a>
                </li> -->
                <!-- <li class="kit-menu-item">
                  <a href="#/layui/handleLog">
                    <i class="layui-icon"></i>
                    <span>操作日志</span>
                  </a>
                </li> -->
                
                
              
              </ul>
            </li>
            
            
          </ul>
        </div>
      </div>
    </div>
    <!-- main -->
    <div class="layui-body" kit-body="true">
      <router-view></router-view>
    </div>
    <!-- footer -->
    <div class="layui-footer" kit-footer="true">
      	希鸟科技
      <div style="width:400px; height:400px;" class="load-container load1">
        <div class="loader">Loading...</div>
      </div>
    </div>
  </div>
  <!--<script src="api/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>-->
  <script src="polyfill.min.js"></script>
  <script src="layui.js"></script>
  <script src="kitadmin.js"></script>
  <script src="mockjs-config.js"></script>
	<script src="laydate.js"></script>

	<script type="text/javascript" src="./api/jquery-2.1.0.js"></script>
  <script src="https://cdn.bootcss.com/echarts/4.1.0.rc2/echarts.min.js"></script>
  <script>layui.use('admin');</script>
  <script type="text/javascript" src="./api/DBHelper.js"></script>
  <script src="api/api.js" type="text/javascript" charset="utf-8"></script>
  <script type="text/javascript">
    if (localStorage.getItem('token') == null) {
//    alert('请先登录')
      location.href = "/admin/login.html"
    }
    $('#name').text(localStorage.getItem('userName'))
    var userGuid = localStorage.getItem('userGuid')
    DBHelper.Get('Admin_Xn_Page',function (a) {
      var childArea = $('.kit-menu-child')

      //用户找用户组
      DBHelper.Get('Admin_Xn_User?UserGuid='+userGuid,function(res){
        // console.log(res)
        //用户组找页面
        DBHelper.Get('Admin_Xn_GroupPage?GroupGuid='+res.GroupGuid,function(resa){
          console.log(resa)
          //4.页面guid找页面信息
          let arr = [];
          for(let w = 0 ; w < resa.length ; w++){
            DBHelper.GetA('Admin_Xn_Page/'+resa[w].PageGuid,function (resb) {
            	
            	arr.push(resb)
            	//        排序
          
            	
//            for(let q = 0 ; q < childArea.length ; q++) {
//              if($(childArea[q]).attr('data-value') == resb.OneID){
//                $(childArea[q]).append('<li class="kit-menu-item">\
//                                          <a href="'+resb.PagePath+'">\
//                                            <i class="layui-icon"></i>\
//                                            <span>'+resb.Name+'</span>\
//                                          </a>\
//                                        </li>')
//              }
//            }
            },function (resb) {
              // body...
            })
                  
          }
			arr.sort(function(a,b){
            		return a.OrderID-b.OrderID
            	})
			console.log(arr,"arr")
          
          
          	for(let q = 0 ; q < childArea.length ; q++) {
          		for(let z = 0 ; z<arr.length ; z++){
          			if($(childArea[q]).attr('data-value') == arr[z].OneID){
		                  $(childArea[q]).append('<li class="kit-menu-item">\
		                                            <a href="'+arr[z].PagePath+'">\
		                                              <i class="layui-icon"></i>\
		                                              <span>'+arr[z].Name+'</span>\
		                                            </a>\
		                                          </li>')
		                }
          		}
          	
          	}
          

          for(let p = 0 ; p < childArea.length ; p++) {
            if($(childArea[p]).children().length == 0) {
              $(childArea[p]).parents('.kit-menu-item').remove()
            }
          }
        },function(resa){

        })
        
      },function(res){

      })
    },function(a){

    })
  </script>
</body>

</html>
<style type="text/css">
	.red{
		color: red;
	}
</style>